package com.ftg.midamall.feign;

/**
 * @author qjw
 * @version 1.0
 * @date 2023/11/17 11:01
 */

import com.alibaba.fastjson2.JSONObject;
import com.ftg.midamall.comm.vo.RespMessUtil;
import io.swagger.annotations.ApiParam;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.multipart.MultipartFile;

/**
 * 远程调用上传功能
 *
 * @author kangjx
 * @version 1.0
 * @date 2023/11/16 下午1:41
 */
@FeignClient(name = "uploadMall")
public interface UploadAvatarFeign {

    @PostMapping(value="/upload/uploadAvatar",consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    public RespMessUtil<JSONObject> uploadAvatar(@ApiParam("avatarFile") @RequestPart("avatarFile") MultipartFile avatarFile);


    /**
     * 删除头像功能,根据现有的头像地址信息，
     * 信息是个人中心修改时获得的数据表中头像
     *
     * @param avatarFileUrl 头像文件地址
     * @return 响应结果对象，包含上传结果信息
     */
    @PostMapping("/upload/delAvatar")
    RespMessUtil<JSONObject> delAvatar(@ApiParam("avatarFileUrl") @RequestParam("avatarFileUrl") String avatarFileUrl);

}